package org.easyorm.groovy

public class SimpleEntityManager extends EntityManager {

	public SimpleEntityManager() {}

	public SimpleEntityManager(String url, String username, String password, String driverClassName) {
		super(url, username, password, driverClassName)
	}

	String getTableName(Object entity) {
		return entity.class.getSimpleName()
	}

	Map getFieldValuePairs(Object entity) {
		SortedMap fieldValues = new TreeMap()
		entity.properties.each {key, value ->
			if (!(key in RESERVED_PROPS)) {
				fieldValues.put(key, value)
			}
		}
		return fieldValues
	}
}
